package com.pcl;

import com.pcl.db.DBMgr;

/**
 * Hello world!
 * 
 */
public class App {
	public static void main(String[] args) {
		System.out.println("Hello World proguard!");
		// execute ProGuard [-injars, 'E:\work\proguarddemo\target\proguarddemo-1.0-SNAPSHOT_proguard_base.jar'(!META-INF/maven/**), -outjars, 'E:\work\proguarddemo\target\proguarddemo-1.0-SNAPSHOT.jar', -libraryjars, 'C:\Users\AnSense\.m2\repository\mysql\mysql-connector-java\5.1.24\mysql-connector-java-5.1.24.jar', -libraryjars, 'D:\Program Files\Java\jdk1.6.0_31\jre/lib/rt.jar', -printmapping, 'E:\work\proguarddemo\target\proguard_map.txt', -printseeds, 'E:\work\proguarddemo\target\proguard_seeds.txt', -allowaccessmodification, -keepclasseswithmembers public class *  { public static void main(java.lang.String[]);}]
		//参数变量指针多指向不同的类型实例
		privateVoidStaticNoParames();//无参数，合并
		privateVoidStaticParames(10);//变量名字被更改a(int paramInt)
		publicVoidStaticNoParames();//  private static void a()
		publicVoidStaticParames(10);//  private static void b(int paramInt)
		//没有调用的方法被删除了
		publicCallOtherVoidStaticNoParames();//无参数被合并代码块,DBMgr类被改名字a
		publicCallOtherVoidStaticParames(5);//有参数外调用被合并代码块,DBMgr类被改名字a
	}

	private static void privateVoidStaticNoParames() {
		String name = "long";
		for (int i = 0; i < 10; i++) {
			name += "1000";
		}
		System.out.println(name);
	}

	private static void privateVoidStaticParames(int loop) {
		String name = "long";
		for (int i = 0; i < loop; i++) {
			name += "1000";
		}
		System.out.println(name);
	}

	public static void publicVoidStaticNoParames() {
		String name = "long";
		for (int i = 0; i < 10; i++) {
			name += "1000";
		}
		System.out.println(name);
	}

	public static void publicVoidStaticParames(int loop) {
		String name = "long";
		for (int i = 0; i < loop; i++) {
			name += "1000";
		}
		System.out.println(name);
	}

	//没有调用其他类的static 公共方法
	public static void publicCallOtherVoidStaticNoParames() {
		DBMgr db;
		try {
			db = new DBMgr(1);
			System.out.println(db.state());
		} catch (Throwable e) {
			e.printStackTrace();
		}

	}

	public static void publicCallOtherVoidStaticParames(int index) {
		DBMgr db;
		try {
			db = new DBMgr(index);
			System.out.println(db.state());
		} catch (Throwable e) {
			e.printStackTrace();
		}

	}

	//没有调用的公共方法
	public void publicNoCallVoidNoParames() {
		DBMgr db;
		try {
			db = new DBMgr(1);
			System.out.println(db.state());
		} catch (Throwable e) {
			e.printStackTrace();
		}

	}

	public static void publicNoCallVoidParames(int index) {
		DBMgr db;
		try {
			db = new DBMgr(index);
			System.out.println(db.state());
		} catch (Throwable e) {
			e.printStackTrace();
		}
	}

	//没有调用的保护方法
	protected void protectedNoCallVoidNoParames() {
		System.out.println("protectedNoCallVoidNoParames");
	}

	//没有调用的保护方法
	private void privateNoCallVoidNoParames() {
		System.out.println("privateNoCallVoidNoParames");
	}

}
